package com.theme.passport.dao;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.theme.passport.entity.test.Dish;
import com.theme.passport.entity.test.DishDto;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

/**
 * @author: 可乐加糖
 * @create: 2023-02-10 15:58
 * @Description: 测试连表查询(多表联查)
 */
@Mapper
public interface DishMapper extends BaseMapper<Dish> {
    @Select("select a.id,a.name,b.name as categoryname,a.price,a.code,a.image,a.description,a.status,a.sort,a.create_time,a.update_time,a.create_user,a.update_user,a.is_deleted from dish a left join category b on a.category_id = b.id ${ew.customSqlSegment}")
    //Page<DishDto> selectDishDtoPage(Page<DishDto> page, @Param(Constants.WRAPPER) Wrapper<DishDto> wrapper);
    Page<DishDto> selectDishDtoPage(Page<DishDto> page_dishDto, LambdaQueryWrapper<DishDto> wrapper);

}